package com.larry.spark.rdd.transform

import org.apache.spark.{SparkConf, SparkContext}

object RDD_Oper_Test_1 {

  def main(args: Array[String]): Unit = {
    //TODO  使用spark

    val conf = new SparkConf().setMaster("local[*]").setAppName("rdd")
    val sc = new SparkContext(conf)

    val rdd = sc.textFile("data/apache.log")

    val value = rdd.map(
      line => {
        val strings = line.split(" ")
        strings(6)
      }
    )

//    rdd1.saveAsTextFile("output1")

    value.collect().foreach(println)

    sc.stop()
  }


}
